﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Diagnostics;
using System.ComponentModel;
using WPFExcelReport.Helpers;
using System.Windows.Input;
namespace WPFExcelReport
{
    public partial class TSB31
    {
        public TSB31()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VBSGROE();
            this.DataContext = MV;
            InitializeComponent();
        }
        public override void OnEXAUFChg(string vlaue)
        {
            if (EXAUF.Length < 22)
                return;
            dwData = TBMain.NewRow();
            dwData["BSGMANDANT"] = app.Mandant;
            dwData["BSGART"] = EXAUF.Substring(0, 20); 
            SResult = TMV.QBSGROE04(dwData);
            MergeData(SResult, true);
            base.OnEXAUFChg(vlaue);
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            vwMaster.View.MoveCurrentTo(-1);
        }
      
        public override void ManageCommand(object sender, RoutedEventArgs e)
        {
            if (IsManage)
            {
                OnEXAUFChg(EXAUF);
            }
            else
            {
                VICC_WFEVENTS.SVWF.UBS07(RUNID, KEY);

            }
            base.ManageCommand(sender, e);
        }

    }
}
